﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;

namespace NetCommand
{
    public class Win32
    {
        /// <summary>
        /// 内存复制
        /// </summary>
        /// <param name="dest">目标</param>
        /// <param name="src">源</param>
        /// <param name="count">数目</param>
        /// <returns></returns>
        [DllImport("msvcrt.dll", EntryPoint = "memcpy", CallingConvention = CallingConvention.Cdecl, SetLastError = false)]
        public static extern IntPtr memcopy(byte[] dest, byte[] src, int count);

        /// <summary>
        /// 内存复制
        /// </summary>
        /// <param name="dest">目标</param>
        /// <param name="src">源</param>
        /// <param name="count">数目</param>
        /// <returns></returns>
        [DllImport("msvcrt.dll", EntryPoint = "memcpy", CallingConvention = CallingConvention.Cdecl, SetLastError = false)]
        public static extern IntPtr memcopy(byte[] dest, string src, int count);
       
        /// <summary>
        /// 内存赋值
        /// </summary>
        /// <param name="dest">目标</param>
        /// <param name="value">值</param>
        /// <param name="count">数目</param>
        /// <returns></returns>
        [DllImport("msvcrt.dll", EntryPoint = "memset", CallingConvention = CallingConvention.Cdecl, SetLastError = false)]
        public static extern IntPtr memset(byte[] dest, int value, int count);
    }
}
